package live.hotel.dao.impl;

import java.util.List;

import com.hotel.api.entity.HotelItem;
import com.hotel.api.entity.Room;


public class RoomManage {
	private Room room = null;
	public Room getSelectRoomInfo(List<HotelItem> hotels, String hotelCode,
			String roomCode) {
		for (HotelItem hotelInfo : hotels) {
			if (hotelCode.equals(hotelInfo.getHotelCode())) {
				for (Room roomPix : hotelInfo.getRooms()) {
					if (roomCode.equals(roomPix.getRoomCode())) {
						room = roomPix;
					}
				}
			}
		}
		return room;
	}
	
	public Room getSelectRoomInfo(HotelItem hotelInfo, String hotelCode,
			String roomCode) {
			if (hotelCode.equals(hotelInfo.getHotelCode())) {
				for (Room roomPix : hotelInfo.getRooms()) {
					if (roomCode.equals(roomPix.getRoomCode())) {
						room = roomPix;
					}
				}
			}
		return room;
	}
}
